<?php
    $this->set('documentData', array(
        'xmlns:dc' => 'http://purl.org/dc/elements/1.1/'));

    $this->set('channelData', array(
        'title' => __("Most Recent Posts", true),
        'link' => $this->Html->url('/', true),
        'description' => __("Most recent posts.", true),
        'language' => 'en-us'));

    foreach ($posts as $post) {
        $postTime = strtotime($post['New']['created']);
 
        $postLink = $post['New']['url'];
        // You should import Sanitize
        App::import('Sanitize');
        // This is the part where we clean the body text for output as the description 
        // of the rss item, this needs to have only text to make sure the feed validates
        $bodyText = preg_replace('=\(.*?\)=is', '', $post['New']['content']);
        $bodyText = $this->Text->stripLinks($bodyText);
        $bodyText = Sanitize::stripAll($bodyText);
        $bodyText = $this->Text->truncate($bodyText, 400, array(
            'ending' => '...',
            'exact'  => true,
            'html'   => true,
        ));
 
        echo  $this->Rss->item(array(), array(
            'title' => $post['New']['site'],
            'link' => $postLink,
            'guid' => array('url' => $postLink, 'isPermaLink' => 'true'),
            'description' =>  $bodyText,
            'dc:creator' => 'Dealcruncher',
            'pubDate' => $post['New']['created']));
    }
